Electronic devices, such as smartphones and tablets, typically include a touch panel. A user typically controls such an electronic device by touching the touch panel. An electronic device that detects a gesture performed by the user at a distance from the terminal using a proximity sensor, such as an infrared sensor, and then processes an input operation corresponding to the gesture has been proposed in recent years